'''
Created on Jan 22, 2012

@author: jonathan
'''

import jinja2
import os

class JinjaTemplate:
    _jinja_environment = jinja2.Environment(
        loader=jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), "../View")))
    
    def __init__(self, templateFile):
        self._template = self._jinja_environment.get_template(templateFile)
        self._context = {}
    
    def __setitem__(self, key, value):
        self._context[key] = value
    
    def render(self):
        return self._template.render(self._context)